package com.search.service.impl;


import com.alibaba.fastjson2.JSONObject;
import com.search.service.BorrowBookService;
import com.search.service.DoubanBookCapitalService;
import lombok.extern.slf4j.Slf4j;
import org.jsoup.nodes.Document;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class DoubanListFromCapitalService extends DoubanBookCapitalService {

    @Autowired
    private BorrowBookService borrowBookService;

    @Override
    public String getListIdfromUrl(String url) {
        int index = url.indexOf('t');
        String listId = url.substring(index+2,url.length());
        if(listId.endsWith("/")){
            listId.replace("/","");
        }
        return listId;
    }

    @Override
    public String dealUrl(String url, int bookSum) {
        return "";
    }

    @Override
    public Integer bookSumIncrease(Integer bookSum) {
        return 0;
    }

    @Override
    public List<JSONObject> dealPageData(Document doc) {
        return null;
    }

}
